The file-naming bits weren't handling the staticlib case
}
}
+ pub fn is_staticlib(&self) -> bool {
+ match self.kind {
+ LibTarget(ref kinds) => kinds.iter().any(|&k| k == StaticLib),
+ _ => false
+ }
+ }
+
pub fn is_bin(&self) -> bool {
match self.kind {
BinTarget => true,
if target.is_rlib() {
ret.push(format!("lib{}.rlib", stem));
}
+ if target.is_staticlib() {
+ ret.push(format!("lib{}.a", stem));
+ }
}
assert!(ret.len() > 0);
return ret;
let hour = 1000 * 3600;
let mut newtime = stat.modified - hour;
- // FIXME: this looks like a bug on windows that needs to be fixed
- // upstream
- if cfg!(windows) {
- newtime = newtime * 1000;
- }
fs::change_file_times(path, newtime, newtime)
}
}
compiling = COMPILING,
dir = p.root().display()).as_slice()));
})
+
+test!(simple_staticlib {
+ let p = project("foo")
+ .file("Cargo.toml", r#"
+ [package]
+ name = "foo"
+ authors = []
+ version = "0.0.1"
+
+ [[lib]]
+ name = "foo"
+ crate-type = ["staticlib"]
+ "#)
+ .file("src/lib.rs", "pub fn foo() {}");
+
+ assert_that(p.cargo_process("cargo-build"), execs().with_status(0));
+})